﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Ionic.Zip;

namespace NagnagyPrint
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
                        string downlodedfile =textBox1.Text;
            ReadOptions optionzip = new ReadOptions();
            using (ZipFile zip = ZipFile.Read(downlodedfile, optionzip))
            {
                // This call to ExtractAll() assumes:
                //   - none of the entries are password-protected.
                //   - want to extract all entries to current working directory
                //   - none of the files in the zip already exist in the directory;
                //     if they do, the method will throw.
                string downloaded_file = downlodedfile.Substring(0, downlodedfile.IndexOf(".zip"));

                zip.ExtractAll(downloaded_file);

            }

                        //MessageBox.Show(exc.Message);

                    
        }
    }
}
